package com.opengw.configuration.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "config_user")
public class ConfigUser implements Serializable{
	
	private static final long serialVersionUID = -3379507731456148680L;
	private long configUserId;
	private String username;
	private String password;
	private List<ConfigGroup> groupList;
	
	public void setUsername(String username) {
		this.username = username;
	}
	@Column(name = "username")
	public String getUsername() {
		return username;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Column(name = "password")
	public String getPassword() {
		return password;
	}

	public void setGroupList(List<ConfigGroup> userGroupList) {
		this.groupList = userGroupList;
	}

	@ManyToMany(mappedBy = "userList")
	@Column(name = "group_id_ref")
	public List<ConfigGroup> getGroupList() {
		return groupList;
	}
	public void setConfigUserId(long configUserId) {
		this.configUserId = configUserId;
	}
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "user_id")
	public long getConfigUserId() {
		return configUserId;
	}

}
